package com.loyal.loyalerp.basedata.permission.util;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.loyal.loyalerp.system.mapper.GySystemMapper;

public class SystemDeserialize extends JsonDeserializer<String> {

	@Autowired
	GySystemMapper systemMapper;
	
	@Override
	public String deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
		System.out.println("进来了");
		String systemName=jp.getText();
		String systemCode=systemMapper.selectSystemCodeBySystemName(systemName).getSystemcode();
		
		
		return  systemCode;
		
	}

	

	
}
